//
//  Category.h
//  ZFPlatform
//
//  Created by magus on 11-6-2.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>


@implementation UINavigationBar (UINavigationBarCategory)

- (void)drawRect:(CGRect)rect
{
//	// Drawing code
//	UIImage *navBarImage = [UIImage imageNamed:@"导航栏背景.png"];
//	CGContextRef context = UIGraphicsGetCurrentContext();
//	CGContextTranslateCTM(context, 0.0, self.frame.size.height);
//	CGContextScaleCTM(context, 1.0, -1.0);
//	
//	CGPoint center = self.center;
//	
//	CGImageRef cgImage= CGImageCreateWithImageInRect(navBarImage.CGImage, CGRectMake(0, 0, 1, 44));
//	CGContextDrawImage(context, CGRectMake(center.x-160-80, 0, 80, self.frame.size.height), cgImage);
//	CGContextDrawImage(context, CGRectMake(center.x-160, 0, 320, self.frame.size.height), navBarImage.CGImage);
//	CGContextDrawImage(context, CGRectMake(center.x+160, 0, 80, self.frame.size.height), cgImage);
	
	UIImage *bkImage = [UIImage imageNamed: @"导航栏背景.png"];  
    [bkImage drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
	
	//设置导航栏按钮颜色
	self.tintColor = [UIColor colorWithRed:213.0/255 green:33.0/255 blue:2.0/255 alpha:0.3];
}

@end